package org.hishen.example.web.admin;

import javax.annotation.Resource;

import org.hishen.example.service.admin.system.MenuService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(IndexController.PATH)
public class IndexController {
	public final static String PATH = "/admin";
	public final static String RELOAD = "redirect:/admin";
	
	@Resource
	private MenuService menuService;
	
	@RequestMapping
	public String index(Model model) {
		model.addAttribute("menus", menuService.getRoot());
		return PATH + "/index";
	}
}
